<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的文章详情</title>
    <script src="jquery-1.9.1.min.js"></script>
    <script>
        //时间格式化
        function datefm(timespan) {
            var date = new Date(timespan);
            var y = date.getFullYear();//年
            var m = date.getMonth() + 1;//月//因为月份默认是上月的
            var d = date.getDate();
            return y + "-" + m + "-" + d;
        }

        jQuery(function () {
            var id = location.search.split("=")[1];
            jQuery.getJSON("init", {"id": id}, function (data) {
                jQuery("#title").html(data.art.title);
                jQuery("#content").html(data.art.content);
                jQuery("#username").html(data.art.username);
                jQuery("#createtime").html(datefm(data.art.createtime));
                jQuery("#updatetime").html(datefm(data.art.updatetime));
                jQuery("#rcount").html(data.art.rcount);
            });
            //阅读量+1
            jQuery.getJSON("addrcount", {"id": id}, function (data) {

            });
        });
    </script>
</head>
<body style="background-image: url(b2.JPG);background-repeat: no-repeat;background-size: 100% auto">
<!--<body style="background: gainsboro">-->
<div style="margin-top: 50px;text-align: center;">
    <h1 id="title"></h1>
    <div id="content" style="white-space: pre-wrap;">
    </div>

    <hr>
    <div style="text-align: left">
        <a href='myart.html'>返回列表</a>
    </div>
    <div style="text-align: right">

        作者：<span id="username"></span>
        &nbsp;&nbsp;
        发布日期：<span id="createtime"></span>
        &nbsp;&nbsp;
        阅读量：<span id="rcount"></span>

    </div>
</div>
</body>
</html>